home *** CD-ROM | disk | FTP | other *** search
/ Scene 96 / Scene 96 International Edition (Zyklop Software) (Disc 2) (1997).iso / misc / coding / midas060 / src / dma.inc < prev    next >
Encoding:
Text File  |  1997-01-16  |  4.2 KB  |  143 lines

  1. ;*      DMA.H
  2. ;*
  3. ;* DMA handling routines
  4. ;*
  5. ;* $Id: dma.inc,v 1.3 1997/01/16 18:41:59 pekangas Exp $
  6. ;*
  7. ;* Copyright 1996,1997 Housemarque Inc.
  8. ;*
  9. ;* This file is part of the MIDAS Sound System, and may only be
  10. ;* used, modified and distributed under the terms of the MIDAS
  11. ;* Sound System license, LICENSE.TXT. By continuing to use,
  12. ;* modify or distribute this file you indicate that you have
  13. ;* read the license and understand and accept it fully.
  14. ;*
  15.  
  16.  
  17. ;/***************************************************************************\
  18. ;*      struct dmaBuffer
  19. ;*      ----------------
  20. ;* Description: DMA playing buffer
  21. ;\***************************************************************************/
  22.  
  23. STRUC   dmaBuffer
  24.  
  25. IFDEF __16__
  26.         D_int   bufferSeg               ; DMA buffer segment (offset is zero)
  27. ENDIF
  28. IFDEF __PROTMODE__
  29.         D_int   bufDosSeg               ; DMA buffer DOS segment
  30.         D_int   dpmiSel                 ; DMA buffer DPMI selector
  31. ENDIF
  32.  
  33.         D_long  startAddr               ; buffer physical start address
  34.         D_int   bufferLen               ; DMA buffer length in bytes
  35.         D_ptr   memBlk                  ; internal, used for unallocating
  36.         D_int   channel                 ; channel on which the buffer is
  37.                                         ; being played or -1
  38.         D_long  bufDataPtr              ; pointer to DMA buffer data
  39. ENDS
  40.  
  41.  
  42.  
  43.  
  44. ;/***************************************************************************\
  45. ;*
  46. ;* Function:    int dmaAllocBuffer(unsigned size, dmaBuffer *buf);
  47. ;*
  48. ;* Description: Allocates a DMA buffer (totally inside a 64K physical page)
  49. ;*
  50. ;* Input:       unsigned size           size of buffer in bytes
  51. ;*              dmaBuffer *buf          pointer to DMA buffer information
  52. ;*
  53. ;* Returns:     MIDAS error code. DMA buffer information is written to *buf.
  54. ;*
  55. ;\***************************************************************************/
  56.  
  57. GLOBAL  LANG dmaAllocBuffer : _funct
  58.  
  59.  
  60.  
  61.  
  62. ;/***************************************************************************\
  63. ;*
  64. ;* Function:    int dmaFreeBuffer(dmaBuffer *buf);
  65. ;*
  66. ;* Description: Deallocates an allocated DMA buffer
  67. ;*
  68. ;* Input:       dmaBuffer *buf          pointer to DMA buffer information
  69. ;*
  70. ;* Returns:     MIDAS error code
  71. ;*
  72. ;\***************************************************************************/
  73.  
  74. GLOBAL  LANG dmaFreeBuffer : _funct
  75.  
  76.  
  77.  
  78.  
  79. ;/***************************************************************************\
  80. ;*
  81. ;* Function:    int dmaPlayBuffer(dmaBuffer *buf, unsigned channel,
  82. ;*                  unsigned autoInit);
  83. ;*
  84. ;* Description: Plays a DMA buffer
  85. ;*
  86. ;* Input:       dmaBuffer *buf          pointer to DMA buffer information
  87. ;*              unsigned channel        DMA channel number
  88. ;*              unsigned autoInit       1 if autoinitializing DMA is used, 0
  89. ;*                                      if not
  90. ;*
  91. ;* Returns:     MIDAS error code
  92. ;*
  93. ;\***************************************************************************/
  94.  
  95. GLOBAL  LANG dmaPlayBuffer : _funct
  96.  
  97.  
  98.  
  99.  
  100. ;/***************************************************************************\
  101. ;*
  102. ;* Function:    int dmaStop(unsigned channel);
  103. ;*
  104. ;* Description: Stops DMA playing
  105. ;*
  106. ;* Input:       unsigned channel        DMA channel number
  107. ;*
  108. ;* Returns:     MIDAS error code
  109. ;*
  110. ;\***************************************************************************/
  111.  
  112. GLOBAL  LANG dmaStop : _funct
  113.  
  114.  
  115.  
  116.  
  117. ;/***************************************************************************\
  118. ;*
  119. ;* Function:    int dmaGetPos(dmaBuffer *buf, unsigned *pos);
  120. ;*
  121. ;* Description: Reads the DMA playing position
  122. ;*
  123. ;* Input:       dmaBuffer *buf          pointer to DMA buffer information
  124. ;*              unsigned *pos           pointer to playing position
  125. ;*
  126. ;* Returns:     MIDAS error code. DMA playing position from the beginning
  127. ;*              of the buffer, in bytes, is written to *pos.
  128. ;*
  129. ;\***************************************************************************/
  130.  
  131. GLOBAL  LANG dmaGetPos : _funct
  132.  
  133.  
  134. ;* $Log: dma.inc,v $
  135. ;* Revision 1.3  1997/01/16 18:41:59  pekangas
  136. ;* Changed copyright messages to Housemarque
  137. ;*
  138. ;* Revision 1.2  1996/05/30 22:38:46  pekangas
  139. ;* no changes?
  140. ;*
  141. ;* Revision 1.1  1996/05/22 20:49:33  pekangas
  142. ;* Initial revision
  143. ;*